﻿@model projectManagementWeb.Models.Manager.deleteProjectModel

@{
    ViewBag.Title = "deleteProject";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div align="right">
    @Html.ActionLink("<< Regresar", "Index")
</div>

<style type="text/css">
.ui-datepicker { width: 17em; padding: .2em .2em 0; background: #66FF99;}
</style>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".date").datepicker
            ({
                dateFormat: 'mm/dd/yy',
                showStatus: true,
                showWeeks: true,
                highlightWeek: true,
                numberOfMonths: 1,
                showAnim: "scale",
                showOptions: {
                    origin: ["top", "left"]
                }
            });
    });
</script>

<script type="text/javascript">
    function updateData() {
        $("#Name").val("");
        $("#Description").val("");
        $("#startDate").val("");
        $("#endDate").val("");
        var id = $("#ddlID").val();
        $.getJSON("/Manager/loadProjectInfo", { id: id },
					function (data) {
					    $("#Name").val(data.name);
					    $("#Description").val(data.description);
					    $("#startDate").val(data.startDate);
					    $("#endDate").val(data.endDate);
					    $("#projectLeaderID").val(data.projectLeaderID).attr('selected', true);
					    $("#sponsorID").val(data.sponsorID).attr('selected', true);
					    $("#statusID").val(data.statusID).attr('selected', true);
					    //$("#projectLeaderID").val(data.projectLeaderID);
					    //$("#sponsorID").val(data.sponsorID);
					    //$("#statusID").val(data.statusID);
					    
					    
					    
					}
				);
    }

    $(document).ready(
	    function () {
	        updateData();
	        $("#ddlID").change(function () { updateData(); });
	    }
    );

</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Eliminar Proyecto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ID)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.ID, new SelectList(Model.ProjectList, "Value", "Text"), null, new { id = "ddlID" }) 
            @Html.ValidationMessageFor(model => model.ID)
        </div>
 

        <p>
            <input type="submit" value="Eliminar" />
        </p>
    </fieldset>
}


